﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Marmat.Foundation;
using Marmat.Template.WinForm;

namespace 测试项目.TestDemo
{
    class TestFirstDemoEditFormController : Marmat.Template.WinForm.DocumentEditFormController<TestDemoEntity>, IEditFormEditorStyle, IReport, IEditFormCreateController
    {
        public bool AllowCreate { get; set; } = true;

        public override TestDemoEntity CreateDataObject(params object[] arguments)
        {
            var result = base.CreateDataObject(arguments);
            result.Status = "草稿";
            return result;
        }

        public override void Create()
        {
            this.NewDataObject();
        }

        public IEnumerable<IButtonItem> GetReportCollection()
        {
            yield return new ButtonItem("a", "a");
            yield return new ButtonItem("b", "b");
        }

        public void Print(ReportCancelEventArgs e)
        {
        }

        public override void RejectChanges()
        {
            base.RejectChanges();
        }
    }
}
